This repository was archived by the owner on Sep 10, 2023. It is now read-only.
Improving keyboard management and fix timing issues#816
Open
fverry wants to merge 3 commits intoloopj:masterfrom
Open
Improving keyboard management and fix timing issues#816fverry wants to merge 3 commits intoloopj:masterfrom
fverry wants to merge 3 commits intoloopj:masterfrom
Conversation
* Disabling autocorrect * Adding keypress support
Improving keyboard management Issues : * On Safari iPad, the <input> is not updated until keydown() has ended, despite setTimeout(), which causes do_search() to perform over the previous value of the field. * Keypress event returns "l" (lowercase "L", ASCII 108) as keyCode, which is then confused for KEY.NUMPAD_ENTER (keyCode 108). Fixes : * Updating the KEY array to the latest jQuery UI standard : https://github.com/jquery/jquery-ui/blob/e9643f6bfc922773e29e3084e64de0240b547f32/ui/core.js * Replacing event.keyCode by jQuery event.which : https://api.jquery.com/event.which/ * Dissociating keydown/keyup effects : http://www.quirksmode.org/dom/events/keys.html ** Keydown event is used to detect control keys (when the key is pressed, meaning that the effect of the key can be overloaded before it happens) ** Keyup event is used to act upon input changes (when the key is released, meaning that the effect of the key has already happened) ** Keypress event is not used anymore ** Now that do_search() performs only on keyup, the setTimeout() ("just long enough to let this function finish.") seems useless. * Removed stopPropagation(), preventDefault() when redundant with "return false"
* When multiple ajax queries are sent, they might answer in the wrong order ; now the previous ajax query is aborted before the new one is executed * If backspace is hit, and the char length is reduced under minChars, the run_search() timeout is not cleared ; now it is cleared
fd2316b to
8a8390e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues :
despite setTimeout(), which causes do_search() to perform over the
previous value of the field.
which is then confused for KEY.NUMPAD_ENTER (keyCode 108).
Fixes :
https://github.com/jquery/jquery-ui/blob/e9643f6bfc922773e29e3084e64de0240b547f32/ui/core.js
https://api.jquery.com/event.which/
http://www.quirksmode.org/dom/events/keys.html
** Keydown event is used to detect control keys (when the key is
pressed, meaning that the effect of the key can be overloaded before it
happens)
** Keyup event is used to act upon input changes (when the key is
released, meaning that the effect of the key has already happened)
** Keypress event is not used anymore
** Now that do_search() performs only on keyup, the setTimeout() ("just
long enough to let this function finish.") seems useless.
"return false"